//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<frame.h>
///	@path	~/src/graphics/animation/
///	@date	2008/03/22
///	@desc	Frame info & frame helpers.

#pragma once

#include "xeres.h"

namespace xeres {

	/*! 
		\class	Frame
		\brief	Encapsulates basic frame update information.
	*/
	class Frame
	{
	protected:

		/// \name Constructor & Destructor
		//@{

		/// \ctor
		Frame( void );

		/// \dtor
		~Frame( void );

		//@}

	public:

		/// \name Attributes
		//@{

		/*!
			\brief		Get delta time.
		*/
		float dtime( void ) const { return m_updateGap; }

		/*! 
			\brief		Get global time.
		*/
		float gtime( void ) const { return m_global; }

		/*!
			\brief		Get current frame/second.
		*/
		float fps( void ) const { return m_updateFps; }

		/*!
			\brief		Get statistical frame/second.
		*/
		float statfps( void ) const { return m_statFps; }

		/*!
			\brief		Get frame count from engine started.
		*/
		uint frame( void ) const { return m_frameCounter; }

		/*! 
			\brief		Get sub frame counter.
		*/
		uint subframe( void ) const { return m_subframeCounter; }

		/*! 
			\brief		Get super frame state.
		*/
		uint superframe( void ) const { return m_superFrame; }

		//@}

	protected:

		//@ data

		// dtime
		float				m_updateGap;

		// global time
		float				m_global;

		// fps
		float				m_updateFps; // frame/sec
		float				m_statFps; // for statistic fps

		// global counter
		uint				m_frameCounter;
		uint				m_subframeCounter;

		// super frame
		uint				m_superFrame;

	};


} // namespace xeres
